package edu.gdkm.dao.edu.gdkm.dao.edu.gdkm.dao;

import edu.gdkm.pojo.Teacher;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface TeacherXml {
    @Insert("insert into teacher(name,age,mobile,course) values(#{name},#{age},#{mobile},#{course})")
    public boolean save(Teacher teacher);
    @Update("update teacher set name=#{name},age=#{age},mobile=#{mobile},course=#{course} where id=#{id}")
    public boolean update(Teacher teacher);
    @Delete("delete from teacher where id= #{id}")
    public boolean delete(Integer id);
    @Select("select * from teacher where id= #{id}")
    public Teacher findById(Integer id);
    @Select("select * from teacher")
    public List<Teacher> findAll();

}
